package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {

    List<ArticleInfo> getAll();

    @Select("select a.*, u.username from articleinfo as a left join userinfo as u on a.uid = u.id")
    List<ArticleInfo> getAll3();

    @Select("select * from articleinfo where uid = #{id}")
    List<ArticleInfo> getAllByUid(Integer id);

}
